<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <title>舆情监控</title>
    <link rel="stylesheet" th:href="@{/static/css/bootstrap.min.css}"/>
    <style>
         .home{
              margin-top: 100px;
         }
         .container {
             width: 1170px;
         }
        .webpper{
            width: 500px;
            margin-left: 320px;
        }
        h2{
            display: block;
            font-size: 1.5em;
            -webkit-margin-before: 0.83em;
            -webkit-margin-after: 0.83em;
            -webkit-margin-start: 0px;
            -webkit-margin-end: 0px;
        }
        a{
            color: #333;
            touch-action: manipulation;
            background-color: transparent;
            text-decoration: none;
            outline: none;
            cursor: pointer;
            transition: color .3s;
        }
        .card-m{
            text-align: left;
        }

        .sentiment-prob{
            width: 100px;
            display: inline-block;
            height: 15px;
            line-height: 15px;
            text-align: center;
            color: #fff;
            background: #1a8bd2;
            position: relative;
            margin-bottom: 0;
            vertical-align: middle;
        }
         .sentiment-prob span {
             position: absolute;
             height: 15px;
             width: 30px;
             background: #f5222d;
             left: 0;
             z-index: 0;
         }
         .sentiment-prob em {
             z-index: 2;
             display: block;
             position: absolute;
             font-size: 12px;
             text-decoration: none;
             font-style: normal;
             margin-left: 30%;
         }
         .lyrical{
             width: 10px;
             height: 10px;
             border-radius: 50px;
             margin-right: 5px;
         }
        .info-content{
            margin-bottom: 10px;
        }
    </style>
</head>
<body>
<div class="header-wepper">
    <div class="container text-center">
        <span>首页</span>
        <span><a th:href="@{/scan}">舆情检测</a></span>
        <span>产品服务</span>
        <span>解决方案</span>
        <span>资讯中心</span>
        <span>关于我们</span><span class="px-1"/>|<span class="px-1"/>
        <a shiro:authenticated="" th:href="@{/mem/index}"><shiro:principal property="name"/></a>
        <span class="px-1"/>
        <a shiro:authenticated="" th:href="@{/mem/logout}">退出账户</a>
        <a shiro:notAuthenticated="" th:href="@{/mem/login}" style="color: #007bff">登录</a>
    </div>
</div>
<div class="home">
    <div class="container text-center">
        <div class="row">
            <div class="webpper">
                <form id="search" th:action="@{/center/search}">
                    <div class="input-group">
                        <input type="text" id="searchValue" name="searchValue" class="form-control"
                               placeholder="输入关键词">
                        <a href="javascript:sub();" id="but" class="btn btn-info">舆情分析</a>
                    </div><!-- /input-group -->
                </form>
            </div>
        </div>
    </div>
</div>
<div class="home">
    <div id="listInfo" class="container text-center">

    </div>
</div>

<script th:src="@{/static/js/jquery-3.4.1.min.js}"></script>
<script th:src="@{/static/js/bootstrap.min.js}"></script>
<script th:src="@{/static/js/bootstrap.bundle.min.js}"></script>
<script th:inline="javascript">
  function sub(){
      const searchValue = $("#searchValue").val();
      const url=$("#search").attr("action")+"?searchValue="+searchValue;
      //此处通过异步加载子页面获取所需页面具体
      $("#listInfo").load(encodeURI(url));
  }
  
  function pdfDown(fileName) {


      if (fileName===null || fileName===undefined ||fileName === ''){
          return;
      }

      const user = [[${user}]];
      if (user==null){
          alert("请先登录后再下载");
          return;
      }
      const vip = [[${user!=null?user.isVip:false}]];
      if (!vip){
          alert("你还不是高级会员，请联系管理充值会员后下载PDF");
          return;
      }

      window.location.href=[[@{/center/dowload}]]+"?fileName="+fileName;

  }
</script>
</body>
</html>